package com.my.chapter15;

public class practice34 {
    public static void main(String[] args) {
        ConcreteProcessor cp = new ConcreteProcessor();
        System.out.println(cp == cp.test());
    }
}

abstract class
GenericProcessor<T extends GenericProcessor<T>> {
    abstract T process(T arg);
    T test() { return process(null); }
}

class ConcreteProcessor
        extends GenericProcessor<ConcreteProcessor> {
    ConcreteProcessor process(ConcreteProcessor arg) {
        if(arg == null)
            return this;
        return arg;
    }
}
